/*
 * FileName：TreeNode.java 
 * <p>
 * Copyright (c) 2017-2020, <a href="http://www.webcsn.com">hermit (1154808491@qq.com)</a>.
 * <p>
 * Licensed under the GNU General Public License, Version 3 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/gpl-3.0.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package com.smart.primary.sys.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * ztree树节点
 *
 * @author hermit
 * @date 2017 -08-17 09:13:03
 */
@Data
public class TreeNode implements Serializable {

    private String id;// 子节点属性字段

    @JsonProperty(value = "pId")
    private String parentId;// 父节点属性字段

    private String name;// 节点名称

    private String url;// 请求路径，action

    @JsonProperty(value = "isParent")
    private boolean isParent;// 是否是父节点

    private boolean checked;// 是否选中

    private boolean open;// 是否展开

    private boolean nocheck;// 设置节点是否隐藏 checkbox / radio

    private String diyId;// 自定义id

    private String iconSkin;// 推荐使用：设置个性图标的 className

    private String icon;// 不推荐：自定义图标路径 展开、折叠 自定义图标相同

    private String iconOpen;// 不推荐：父节点自定义展开时图标的 URL 路径

    private String iconClose;// 不推荐：父节点自定义折叠时图标的 URL 路径

    private int level; // 层级

    private List<TreeNode> subList;

    private Boolean haveChildren;// 是否是第一个

    private Map<String, String> attrs; // 其他参数

    private boolean childOuter;// 是否允许成为子节点

    private boolean dropInner;// 拖拽到目标节点时，设置是否允许成为目标节点的子节点。

    private boolean dropRoot;// 拖拽到目标节点时，设置是否允许是否成为根节点


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId == null ? null : parentId.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }

    public boolean isParent() {
        return isParent;
    }

    public void setParent(boolean parent) {
        isParent = parent;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public boolean isNocheck() {
        return nocheck;
    }

    public void setNocheck(boolean nocheck) {
        this.nocheck = nocheck;
    }

    public String getDiyId() {
        return diyId;
    }

    public void setDiyId(String diyId) {
        this.diyId = diyId == null ? null : diyId.trim();
    }

    public String getIconSkin() {
        return iconSkin;
    }

    public void setIconSkin(String iconSkin) {
        this.iconSkin = iconSkin == null ? null : iconSkin.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public String getIconOpen() {
        return iconOpen;
    }

    public void setIconOpen(String iconOpen) {
        this.iconOpen = iconOpen == null ? null : iconOpen.trim();
    }

    public String getIconClose() {
        return iconClose;
    }

    public void setIconClose(String iconClose) {
        this.iconClose = iconClose == null ? null : iconClose.trim();
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public List<TreeNode> getSubList() {
        return subList;
    }

    public void setSubList(List<TreeNode> subList) {
        this.subList = subList;
    }

    public Boolean getHaveChildren() {
        return haveChildren;
    }

    public void setHaveChildren(Boolean haveChildren) {
        this.haveChildren = haveChildren;
    }

    public Map<String, String> getAttrs() {
        return attrs;
    }

    public void setAttrs(Map<String, String> attrs) {
        this.attrs = attrs;
    }

    public boolean isChildOuter() {
        return childOuter;
    }

    public void setChildOuter(boolean childOuter) {
        this.childOuter = childOuter;
    }

    public boolean isDropInner() {
        return dropInner;
    }

    public void setDropInner(boolean dropInner) {
        this.dropInner = dropInner;
    }

    public boolean isDropRoot() {
        return dropRoot;
    }

    public void setDropRoot(boolean dropRoot) {
        this.dropRoot = dropRoot;
    }
}
